package com.threegroup.admin.dto;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.threegroup.admin.entity.DishFlavorEntity;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;
import java.lang.annotation.Documented;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 菜品管理
 *
 * @author kohlerm kohlerm@163.com
 * @since 1.0.0 2022-12-16
 */
@Data
@Document(indexName = "dish", shards = 5, replicas = 1, createIndex = true)
public class DishDTO implements Serializable {
    private static final long serialVersionUID = 1L;

	@Id
	private Long id;
	@Field(type = FieldType.Text,analyzer = "ik_max_word")
	private String name;
	@Field(type = FieldType.Long)
	private Long categoryId;
	@Field(type = FieldType.Auto)
	private BigDecimal price;
	@Field(type = FieldType.Auto)
	private String code;
	@Field(type = FieldType.Auto)
	private String image;
	@Field(type = FieldType.Text,analyzer = "ik_max_word")
	private String description;
	@Field(type = FieldType.Auto)
	private Integer status;
	@Field(type = FieldType.Auto)
	private Integer sort;
	@Field(type = FieldType.Long)
	private Long creator;
	@Field(type = FieldType.Date_Nanos)
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
	private Date createDate;
	@Field(type = FieldType.Long)
	private Long updater;
	@Field(type = FieldType.Date_Nanos)
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
	private Date updateDate;
	@Field(type = FieldType.Auto)
	private Integer isDeleted;
	/**
	 *
	 */
	@Field(type = FieldType.Auto)
	private String categoryName;
	/**
	 *DishFlavorEntity实例
	 */
	@Field(type = FieldType.Auto)
	private List<DishFlavorEntity> flavors;





}